home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 10987 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.0 KB  |  38 lines

  1. Newsgroups: comp.lang.c
  2. Path: eso.org!news
  3. From: Nicolas Devillard <nDevil@eso.org>
  4. Subject: is getopt() ANSI and portable ?
  5. X-Nntp-Posting-Host: mc14
  6. Content-Type: text/plain; charset=us-ascii
  7. Message-ID: <31512EC7.389F@eso.org>
  8. Sender: news@eso.org
  9. Content-Transfer-Encoding: 7bit
  10. Organization: ESO - European Southern Observatory, Garching by Munich
  11. Mime-Version: 1.0
  12. Date: Thu, 21 Mar 1996 11:26:15 +0100
  13. X-Mailer: Mozilla 2.01 (X11; I; SunOS 5.4 sun4m)
  14.  
  15. Hello all:
  16.  
  17. I do not want to reinvent the wheel by creating again my own
  18. command line parser. I found this getopt() function being part
  19. of stdlib, but I'd like to know:
  20.  
  21. 1. If it is part of the ANSI C stdlib ?
  22. 2. If it is a portable call ? I cannot find it in the POSIX prog guide.
  23.  
  24. The definition as given by my man page says :
  25.  
  26. SYNOPSIS
  27.      #include <stdlib.h>
  28.  
  29.      int getopt(int argc, char * const *argv,
  30.           const char *optstring);
  31.  
  32.      extern char *optarg;
  33.      extern int optind, opterr, optopt;
  34.  
  35. The call is supported by gcc and acc on Sun4, Solaris, HPUX, IBM AIX.
  36. Thanks for your help,
  37. Nicolas
  38.